@ECHO OFF

set BUILDROOT=%userprofile%\smartdoor\rfap
set INCLUDES=-I%BUILDROOT%\bm-br1 -I%BUILDROOT% -I%BUILDROOT%\HAL\include -I%BUILDROOT%\HAL\source -I%BUILDROOT%\simpliciti -I%BUILDROOT%\wbsl -I%BUILDROOT%\usb\class_cdc -I%BUILDROOT%\usb\library
set DEFINES=-Dchip=1111 -DISM_LF

set DEFINES=-Dchip=1111 -DMRFI_CC1111 -DISM_LF --model-large -DRF_FREQUENCY=433000 --stack-auto --vc --disable-warning 85 --opt-code-size --fomit-frame-pointer

rem sdcc -E %INCLUDES% %DEFINES% -c simpliciti/Applications/main_AP_BM.c
rem sdcc %INCLUDES% %DEFINES% -c test.c
rem sdcc -E %INCLUDES% %DEFINES% -c simpliciti/Components/nwk/nwk_globals.c > out

rem goto :EOF
sdcc %INCLUDES% %DEFINES% -c flash.c
sdcc %INCLUDES% %DEFINES% --disable-warning 126 -c main.c
sdcc %INCLUDES% %DEFINES% -c timer1.c
sdcc %INCLUDES% %DEFINES% -c HAL\source\hal_int.c
sdcc %INCLUDES% %DEFINES% -c HAL\source\hal_mcu.c
sdcc %INCLUDES% %DEFINES% -c HAL\source\clock.c
sdcc %INCLUDES% %DEFINES% -c usb\class_cdc\usb_uart.c
sdcc %INCLUDES% %DEFINES% -c usb\class_cdc\usb_cdc_hooks.c
sdcc %INCLUDES% %DEFINES% -c usb\class_cdc\usb_firmware_library_config.c
sdcc %INCLUDES% %DEFINES% -c usb\library\ccxx11\usb_interrupt.c
sdcc %INCLUDES% %DEFINES% -c usb\library\ccxx11\usb_suspend.c
sdcc %INCLUDES% %DEFINES% -c usb\library\usb_framework.c
sdcc %INCLUDES% %DEFINES% -c usb\library\usb_descriptor_parser.c
sdcc %INCLUDES% %DEFINES% -c usb\library\usb_standard_requests.c
sdcc %INCLUDES% %DEFINES% -c simpliciti\Components\bsp\bsp.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/mrfi/mrfi.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk/nwk_api.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk/nwk.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk/nwk_frame.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk_applications/nwk_freq.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk_applications/nwk_ioctl.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk_applications/nwk_join.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk_applications/nwk_link.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk_applications/nwk_mgmt.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk_applications/nwk_ping.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk_applications/nwk_security.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk/nwk_globals.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Components/nwk/nwk_QMgmt.c
sdcc %INCLUDES% %DEFINES% -c simpliciti/Applications/main_AP_BM.c

sdas8051 -o usb_cdc_descriptor.rel usb\class_cdc\usb_cdc_descriptor.asm
sdcc %INCLUDES% %DEFINES% -c wbsl\wbsl.c

:out